Layered, object space, programmable and asynchronous surface property generation system

ABSTRACT

A method of generating an intermediate layer comprises generating local surface properties for a graphics object from parameter image maps, generating a first object image surface layer based on the local surface properties, storing intermediate surface results as an object image layer from the object local surface properties, and rendering a second object image surface layer based on the stored intermediate surface results.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is continuation of U.S. Nonprovisional patentapplication Ser. No. 16/294,765, filed Mar. 6, 2019, now allowed, whichis a continuation-in-part of International Application No.PCT/US2018/048380, filed Aug. 28, 2018, which claims priority to and thebenefit of U.S. Provisional Patent Application No. 62/551,083, filedAug. 28, 2017, each of which is hereby incorporated by reference hereinin its entirety.

COPYRIGHT

A portion of the disclosure of this patent document contains materialthat is subject to copyright protection. The copyright owner has noobjection to the facsimile reproduction by anyone of the patentdisclosure, as it appears in the Patent and Trademark Office patentfiles or records, but otherwise reserves all copyrights whatsoever.

TECHNICAL FIELD

The present invention relates generally to the efficient generation ofsurface properties for use within a 3-Dimensional rendering system.

BACKGROUND

The eventual goal of a 3D object represented in a computer for graphicsis the generation of a final 2D view space image, or in the case ofreal-time rendering, a sequence of 2D image frames, which is typicallyconnected to an electronic video display device. In the case of VR, twoimages are computed with different view matrices and projections,achieving the stereoscopy required for VR.

This process of converting a 3D object into a view space image isreferred to as rendering. The rendering of 3D objects into a view spaceimage is a cornerstone of computer graphics and game engines. 3D Objectsare built from a collection of surfaces, the properties of which areused to determine the color value of the rendered image in either adirect or indirect way. A surface may consist of primitives as simple asa triangle, or may consist of something complex like a subdivisionsurface. The rendering process usually involves the transformation ofthe 3D elements making up the 3D object's geometry. Techniques forrendering include triangle rasterization, point splatting, or raytracing.

At some point during the rendering process, a color value for everyvisible location must be determined from the 3D object. Since a 3Dobject is a collection of surfaces, this color value is determined fromone or more surface properties at a given projected points locationalong the surface. At each of these points on the surface, there exist anumber of evaluated properties for a given scene and light environment.These properties may be as simple as a resultant color, but may alsoinclude things like positional surface displacement, normal, albedo,specular power and other properties needed to evaluate the resultantimage color. While a simple implementation of a surface property mightdefine the property to be the color itself, more complex propertiesmight be stored and used at the generation of the final view spaceimage. For example, one surface property might be thermal energy, inwhich case the final image may in fact be a conversion from IR energyinto a corresponding color. In some cases, the physical properties canimpact the physical location of the 3D object, as is the case with adisplacement. All graphics and game engines work by rendering 3D objectsby calculating the appropriate surface properties at each point that isneeded for rendering, eventually collapsing these surface propertiesinto a final color.

The process of evaluating these properties is sometimes referred to as amaterial, especially when referring to the final color of the 3D image.This evaluation process is usually heavily customized and programmed toachieve a specific artistic look. Most engines generate surfaceproperties, often reduced to a simple color, via a shader program suchas a vertex shader or a pixel shader. The shader program is generallyconstrained to a view space image in a forward renderer, or as a seriesof view space image shader programs in a deferred renderer.

Both forward and deferred renderers have certain limitations such as noaccess to object local surface properties due to their dependence on theview space image. They have limited ability to discover any givensurface property on a region immediately adjacent or near a given area.These might be needed to calculate a realistic normal from adisplacement map, or neighborhood shading data which could be used tocreate a subsurface scattering effect. In addition, these engines'systems have limited or no ability to reuse or cache intermediatesurface properties, such as shaded values.

In decoupled shading, the final color values are calculated before andindependently of the composition of the scene. However, this approachdoes not allow the re-use and full distribution of the intermediateshading values to solve some of the aforementioned problems, nor does itin and of itself allow distribution of the shading calculations to bedistributed across multiple computing devices with separate memorysystems.

Thus, there is a need for a system by which intermediate surface resultscan be generated from object local surface properties, consumed by thegraphics engine, and stored for future use or re-use. This system willenable a category of effects which are previously impossible,impractical, or inefficient with other types of systems due to the lackof object local surface properties, and the ability to reference andre-use previous results. These intermediate results can increaseefficiency by being able to be preserved across frames, shared amongmultiple renderings of the same scene, progressively updated, and can begenerated by multiple computing systems which may not share memorysystems. This invention solves the problems of high latency cloudrendering by separating and decoupling the expensive parts of renderinga scene, e.g. the generation of the aforementioned surface properties,with the relatively inexpensive part of the scene, the composition ofthe object into a view space image. By utilizing additional prediction,this system can eliminate or mitigate nearly all latency artifacts in adistributed rendering architecture, and can allow trade-offs for localcomputation vs remote computation based at an individual 3D objectlevel. In addition, as generating surface properties can be acomputationally expensive task, this system can increase efficiency bybeing able to preserve the results across multiple frames, share theresults among multiple view space images, progressively update thesurface properties in a sparse or dense fashion, and can also begenerated by multiple systems detached from the system which isperforming the rendering of a view space image.

SUMMARY

According to one example, a system for efficiently generating surfaceproperties for use within a 3D computer visualization is disclosed. Thesystem includes a surface definition that includes information specificto the surface and [1,N] surface layer definitions. These surface layerdefinitions include a multitude of information that is specific to thetype of surface and the properties it desires to model. This informationcan be stored in program memory, local cache, or any N-Dimensional imageformat that is appropriate for the surface being modeled. In addition,there is a corresponding portion of program code which can be consideredto be, but is not limited to a shader (Compute, Pixel, etc.), or anyother program code which results in the generation of surface propertiesfor a 3D rendering system.

This program code can be designed to execute on a plethora of differentprocessors. The corresponding program code can be modeled by specifichardware in a processor which would be invoked instead of the programcode. The system also includes a portion of memory within which to storeintermediate surface results which can be used in the subsequentevaluation of other layers. This memory is assigned dynamically, and canbe specific to the type of processor and memory system used in theevaluation of the program code for the surface layer. This memory can bere-used, shared or otherwise allocated to each surface layer dependingon the requirements of the program code associated with that surfacelayer. The final surface layer is comprised of the intermediate resultsproduced by each surface layer. In its most simplistic form the resultcan be, but is not limited to, an N-Dimensional color value representinga specific color space such as RGB (Red, Green, Blue), HSV (Hue,Saturation, Value), and others. Once the results are generated for theFinal Surface Layers, those values are then able to be utilized in thegeneration of a View Space Image. These results can be compressed,transmitted from one processor or computer to another, and even re-usedacross multiple frames, multiple 3D objects, and multiple View SpaceImages.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing and other advantages of the present disclosure will becomeapparent upon reading the following detailed description and uponreference to the drawings.

FIG. 1 shows an overview of an asynchronous surface property generationsystem, according to aspects of the present disclosure;

FIG. 2 shows an encoding process for the broadcast of layer images froma server to a client, according to aspects of the present disclosure;

FIG. 3 shows a decoding process for the receiving of broadcasts of alayer image to a client from a server, according to aspects of thepresent disclosure;

FIG. 4 shows data and metadata for an instance of an object's surfacesin a scene including both static and non-static data, according toaspects of the present disclosure;

FIG. 5 shows additional data and additional metadata for an instance ofan object's surfaces in a scene including both static and non-staticdata, according to aspects of the present disclosure;

FIG. 6 shows data and metadata for a precal of an object's surface in ascene including both static and non-static data, according to aspects ofthe present disclosure;

FIG. 7 shows a layer processing system, according to aspects of thepresent disclosure;

FIG. 8 shows data and modules contained inside a temporal compensationdatabase, according to aspects of the present disclosure;

FIG. 9 shows a process for updating a layer image, according to aspectsof the present disclosure; and

FIG. 10 shows a process for compositing an object into a view spaceimage, according to aspects of the present disclosure.

While the present disclosure is susceptible to various modifications andalternative forms, specific implementations and embodiments have beenshown by way of example in the drawings and will be described in detailherein. It should be understood, however, that the present disclosure isnot intended to be limited to the particular forms disclosed. Rather,the present disclosure is to cover all modifications, equivalents, andalternatives falling within the spirit and scope of the presentdisclosure as defined by the appended claims.

DETAILED DESCRIPTION

The following definitions are used herein:

Object—a 3D or 2D mesh, consisting of a collection of 3D primitives,such as triangles, 3D vertices, normal etc. An object can also be aparametric primitive such as sub division surfaces.

Surface—the 2D outside of an object, best described as a section of a 3Dmodel flattened to a 2D manifold. Each point on the 3D model maps to aunique place in the 2D manifold and an inverse mapping is also defined,but may not be unique because extra samples may be needed for some typesof operations. That is, multiple 2D points in the manifold may map tothe same location on the 3D model.

Surface Definition—all intermediate layer images and layer programswhich describe how to generate the surface properties as well as theComposite rendering program which consumes the layer images to build animage in the view space image.

Surface Properties—a collection of values which have mapping to anobject's surface, which are needed for rendering an image. Examplesinclude height map displacement, diffuse color, and transparency.Surface properties may be generated statically from the Object, orgenerated by combing runtime state during the execution of a layerprogram.

Surface Layer—an intermediate or final result of a material orsub-material pass which is generated during the generation of thesurface properties.

Final Surface Layers—a final surface layer which is used in anyrendering step.

Layer Program—a program which constitutes a pass in a surfacedefinition, which may consume surface properties, which are eitherstatic and created at the creation of the object, or generated by one ormore layer programs and stored in a layer image. A layer program may beimplemented via a shading hardware system, and may perform shadingoperations, however it may do neither of these operations and as such isdistinct from a shader

Layer Image—an intermediate or final result of a layer program which isgenerated during the execution of a layer program. A layer image is thephysical storage of non-static surface properties, and corresponds to asurface property of the model, either in final or intermediate form. Alayer image is distinct and different from general 2D images and usuallydoes not contain recognizable contents that would normally be associatedwith an image. Thus, a sprite or other similar construct would not beconsidered a Layer Image. In a typical use of a Layer Image, the LayerImage does not contain data which is standardly projected from 3D into2D. Instead, it is an image only that it is stored in a locallycontinuous 2D data structure. It may include large holes, be unevenlysampled and contain hierarchical information equivalent or the same as aMIP map. Because the layer image is not an actual image, it cannot beturned into a view space image directly. It is used as input, combinedwith other input resources by the Composite Rendering Program toactually create a View Space Image.

Layer Image sample—an individual data element of a layer image whichcontains the actual properties, intermediate or final, of the surfacedefinition. One a manifestation of a layer image sample would be a texelif the layer image is implemented as renderable texture on a GPU.

Layer Image Processing DAG—A directed acyclic graph of layer programswhich specify the order of operations and dependencies of which acomputing device needs to execute the layer programs

Layer Image Database—A database containing layer images which are storedin a plurality of computing devices memory, indexed by at a minimum of auniversally unique identifier (UUID) of an object or its' individualsurfaces to be rendered.

Scene Management System—A system which manages relevant Objects in thescene and submits shading requests to the layer processing system, aswell as composite rendering requests to the composite rendering system.

Layer processing System—A system which manages shading requests sent toit by a scene management system, which processes the layer programs on aplurality of computing devices such as a GPU, storing them with theLayer Image Database, and transmitting or receiving layer images fromother layer image processing systems via an encode or decode module

Composite Rendering System—A system which manages composite renderingrequests from the scene management system and renders a view spacerepresentation of objects into one or more View Space Images.

Layer control image—a Layer Image with a value that determines which, ifany, Layer Image Samples of a Layer Image were consumed by the compositerendering program

Final layer control image—a union of the layer control images

Precal—a program and data which can operate on any layer image but isdefined outside the surface definition A precal is typically used toperform modifications to a 3D model, such as burn marks on wood whichoccur dynamically.

Composite Rendering Program—a program which consumes the Layer Imageswhich contain Surface Properties and renders a view space representationof an Object into a plurality of View Space Images

View Space Image—a 2D image defined by a virtual or physical camera,wherein the bounds of the image directly relate to the orientation, andprojection methods of the camera

Object Space—a 2D mapping and coordinate system which exists on thesurface of an object. It represents a distinct and different coordinatesystem from a View Space Image and unlike a View Space image can be madeto be invariant across time, or in cases where it is not invariant,exactly mappable from previous coordinate mappings.

Engine—a large software program which processes input from a user anddisplays results on a display. An engine may include components whichrun on different physical computers, such as a server and a client.

Temporal Compensation—the act of compensating for latency between thecreation of a layer image and its' consumption, either by another layerprogram or a composite rendering program. Temporal compensation isdifferentiated from general prediction in that it may represent a rangeof possible motions rather than a specific point in time. That is,temporal compensation is plurality of possible points in the future thatcan be considered as a whole to create the best possible approximationof the layer images for the point of time at which they will be used ina View Space Image. Thus, temporal compensation is a superset ofprediction.

Temporal Compensation Database—a database containing data to be used bylayer programs, decal programs, and composite rendering programs toapply temporal compensation.

Several main paradigms exist for the generation of surface propertieswhich are then used to render a final view space image. In many cases,the surface properties exist only temporarily in the renderingarchitecture. In a forward renderer, the surface properties aregenerated via a pixel shader in an on-demand system. However, thesamples generated by these shaders do not have access to anyintermediate layers that might exist, nor do they complete access toneighborhood surface properties, or other samples from shaders, in acontinuous R2 space. Nor can these values generated be easily reused fora different view or subsequent frame.

In a deferred renderer, the generation of surface properties is eithercompletely or partially deferred. A pixel shader (or fragment shader)instead of evaluating final surface properties such as color, savesproperties into view space image buffers like a g-buffer. Theseintermediate buffers are then processed into final surface parameters,typically a color for a rendered image, via a GPU program which runsacross the entire display screen. Because deferred rendering occursacross the entire frame, it is difficult or impossible to operatedifferent execution paths on the intermediate results for each object,requiring them to be rendered in the same manner.

This disclosure, by contrast, performs surface parameter evaluation,which would include any shading. This evaluation and generation isindependent of any view and occurs before any process of rendering the3D object to the view space image. In addition, the surface propertiesof each object can be stored for an arbitrary amount of time, and thesurface properties of each object remain intact and local to that objectto whatever extent is required. In a deferred renderer, even if previousg-buffers are stored, it is at once a complex process to find thesurface properties for a given object, nor is there any means to storeor find a surface property of any part of the object which might havebeen partially occluded during the rendering step.

An object image layer is a piece of memory on a computing device whichstores intermediate surface properties in a form that is continuous inR2, an example would be a regular grid, such that it is similar to thatof an image at a local area. This object image layer is distinct fromimage layers of normal images in that interpreted by itself without themapping of a 3D object, the image layer is incapable of beinginterpreted as an image for display. This object image layer insteadserves as a storage vehicle for other stages of the rendering process.

Although this disclosure uses object image layers, it is contemplated touse other means of so long as neighborhood information for surfaceproperties can be maintained, since neighborhood information is neededfor rendering of the final image.

There are two types of object image layers used by this system. Thefirst type is an intermediate object image layer, which as the namesuggest, stores intermediate values which are used by the programmablepart of the surface evaluation to achieve a certain material or artisticlook. The second type is the final object image layer, which can alsocorrespond to one of the intermediate object layers. These layers arestorage places for operations which need to be accessed by other layers.

Each 3D Object stores its surface parameters via a final object imagelayer, and this system preserves the surface parameters in a memorywhich is close to the device which will eventually render with it. For aGPU rendering, it would store it on GPU memory. If the computation ofsurface properties occurs on multiple physical devices, then there willexist multiple copies of the surface parameters on different deviceswhich will need to be synchronized. Each object's surface parameters andnecessary information are stored in a database referenced by anidentifier code which is provided when an object is specified to haveits surface parameters evaluated. This same identifier code is used whenspecifying the rendering of the object with the surface parameters thathave already been generated for a view space image.

Referring now to FIG. 1, a surface definition program is defined inlanguage surface definition program. This program is compiled into acollection of layer programs, composite rendering programs, meta dataproviding information of how to bind resources and data to the programs,and information about how to process and provide for the layers such asthe Image Layer DAG. This program can be compiled during the compilationof the software which is performing the rendering but could be compiledand loaded dynamically.

Parametrized Objects are created which contain the static data whichwill be consumed by the layer programs and the composite renderingprogram. The collection of all meta data and parametrized objects iscalled the surface property scene definition. In some cases, the serverand client may not have the same data. This data is often in form ofvarious surface properties which can be deduced or are provided by anObject but are invariant.

Next, an engine, such as would be used by a video game, will calculateand submit scene metadata, and provide information relevant to thetemporal compensation of this scene at some point in the future. Forexample, a host compute program may have detailed information about thepath of the camera, in which as it will provide the camera's currentposition, and a few future positions or ranges of positions.

This information is processed by a scene management system, whichincludes components as a model view controller, terrain, and so forth.This scene management system manages the scene and creates a temporallycompensated plurality of state of the scene at a range of time. Thisplurality of state is stored in the temporal compensation database,either directly or via a sequence of messages.

The engine may also broadcast, for each Object, layer image modifiers,called precals, which can modify the contents of any layer image via aprecal program. The precal programs are arbitrary programs containedoutside the scope of the surface property definition. The scene managerarbitrates and broadcasts any precals for each 3D object to the layerprogram processor.

Because the object layer images map to physical locations on the 3Dobject, precals allow the object layer image can be modified such thatany modifications occur on the surface properties of the 3D object. Thisis the opposite of decals, since precals occur before any of the objectimage layers are processed. In this process, a physical location of the3D model is located and then mapped onto one or more object imagelayers, and then data is rendered into the object layer imagecorresponding to the modifications desired for the surface properties.

Using this temporally compensated plurality of state, the scenemanagement system calculates a weight on the number and priority of each3D object and its' individual layers to be processed. The scenemanagement system applies a series of rules and metrics to create acollection which includes objects which might not be visible, but whichare likely to be visible shortly. This collection of objects with theirvarious information about their layer images which need processing issubmitted to the layer program system.

The layer program system processes the per object instance meta datasent to it by one or more scene management systems, as well as anyprecal messages. The layer processor begins by binding the staticsurface properties, layer images, and per object instance meta data, byusing additional meta data provided in the surface definition language,taking into account bindings whose data which is consumed by either thelayer program, precal program, or composite rendering program may needto be temporally compensated. This submission is in the form of messageswhich can be redirected across a network in some configurations. Duringthis process, relevant process times are recorded which can be appliedin the aforementioned step for temporal compensation.

During this submission, in addition to the layer images that needprocessing, any all data which is required for the generation of thelayer images is also sent by the scene management system. The layerimage processing system considers, in their entirety, all of the layerprograms and resultant updated layer images which require processing andacquires and manages memory needed by Layer Images. Layer programs arethen executed on a computing device such as a GPU, with each layerprogram producing one or more layer images, which are potentially storedin the computing devices memory, but in the case of intermediate layerimages, may be stored a form local to the computing device that is notbacked by external memory, such as shared local memory as used by acompute shader.

The layer programs are executed with temporal frequency which isindicated by meta data on the surface property definition. Some layerprograms may update when the host system, such as gameplay, marks thelayer image as dirty. Layer programs may also read and write to the samelayer images such that the layer program becomes an intermediate step.The precal programs are processed after their appropriate layer programor a clearing of a layer image, based on meta data specified in eachlayer program which determines which types of precals it depends on. Inthis manner, a precal can both read and write from any image layer. Theprogram is defined outside the surface definition and the precals mayexecute on specific subsections of the layer image.

The layer programs are always executed in sequence defined Layer ProgramDAG such that all of the data from a dependent layer is known to becompleted before the next layer is executed. The layer processing systemwill perform on computing device any necessary decompression or cacheinvalidation commands required to make a layer image data coherent tosubsequent layer programs. This allows adjacent data to be available,and operations which require it, such as a Gaussian blur, are possible.

If the layer processing system is running in a server/client mode, thelayer processing system stores all variants of any client which may beconnected to it and compares the results of its' output to the knownversion of the image layer on the client. This information is consumedby an encode module (FIG. 2) which encodes the image layers to acompressed stream of data, which is transmitted by the server layerprocessing system to the client layer processing system. Only layerimages which are consumed by the client version of the layer processingsystem and or composite rendering system are transmitted. The clientlayer processing system then decodes the messages via a decode module(FIG. 3) and applies the changes to the Layer Images to its' Layer Imagedatabase.

In the final process, the composite rendering generates view spacerepresentations of the object which are used are used to generate viewspace images, via the execution of the composite rendering program.

The input of the system is a set of parameter image maps (such asposition, displacement, tangent, etc.), the intermediate results areknown as intermediate object image layers, and the object image layerswhich are used for rendering an image are final object image layers.

The program which executes on each layer is called a layer shader.Though the layer images are typically two-dimensional, intermediate offinal color layers could be higher dimension so long as the appropriatecoordinate mapping is provided. The coordinate may be non-spatial, forexample, a third coordinate might represent the surface changing over atime period. Or, an object image layer may be a voxel representation.

The layers are defined in a material definition language which allowsthe user to fully customize the input, output, and layer shadingoperations required. The object image layer shaders can be executed inany order as long as the results are consistent with the shading orderspecified in the material definition. It is not required that eachObject Image Layer be evaluated at the same sampling rate as the otherObject Image Layers. Each Object Image Layer may specify a differentsampling rate function to determine the sampling rate desired for eachObject Image Layer. The sampling rate function may be as simple as amultiplication of the default sampling rate, which is typically anestimated view area function. It may also involve a different screensize projection or take into account other view space factors such aschromatic aberration on a VR display.

Because each object image layer shader can store its results, each layershader has access to results of the other layer shaders for use asinput. This allows for operations which would otherwise be unstable orimpossible to be performed in a dynamic, performant, and stable fashion.For example, instead of a static normal map being stored with an object,it is now straightforward to calculate a normal dynamically by creatingan intermediate G buffer and performing straightforward filteringoperations on it. This is possible because the layer shaders use anobject space which preserves local neighborhood information suitable forgenerating many different types of intermediate surface properties suchas curvature maps, local ambient occlusion, and so forth. In addition tofiltering, operations such as a wide Gaussian blur can be easily beapplied to intermediate shade information without any special casehandling.

In contrast, while G-Buffers have been used in deferred renders todynamically create normal, the results are unstable and often unusablebecause the local neighborhood information needed for a stable filtercannot be present due to its dependence on view specific properties, andthe g-buffer is highly susceptible to variations from frame to frame,causing a shimmering effect.

For example, a wide Gaussian blur can easily be represented as a layershader, requiring no special cases which are common in other materialsystems. The final surface result value, which is often a color value,is then consumed by a scene rasterization step.

There may also exist surface properties which could be unique fordifferent view space images, but be computed simultaneously for improvedefficiency. Examples of this include rendering multiple view spaceimages (one for each eye) for a VR system, or rendering multiple viewspace images for multiple users in the same 3D scene at the same time.Thus, each object image layer shader may write to multiple object imagelayers simultaneously.

A typical surface parameter program sequence which generates finalsurface properties representing humanoid skin is contemplated. Thisprocess starts with a height map, generates a normal map using thisheight layer, performs a lighting calculation, applies a blur, andfinally results in two parameter maps—one that represents a shadedcolor, and the other which represents a displacement from the base mesh.

Surface Definition Language

ConstantSet MaterialConstants {  [Name = “Camera”][SubName = “View”] float4x4 ViewMatrix;  [Name = “Time”][SubName=”Seconds”]  FloatTimeInSeconds;  [Name = “Environment”][SubName = “SunColor”]  Float3SunColor ={ float3(1,.8,1) }; } ResourceSet InputSurfaceProperties { [Name = “ObjectInputs”][SubName = “DisplementMap”]  Texture2DDisplacementMap;  [Name = “Inputs”][SubName = “Layer”][Index = 0]; Textuer2D ProcessedDisplacement; [Name = “Inputs”][SubName =“Layer”][Index = 1];  Textuer2D ComputedNormal; } ResourceSetOutputLayerImages {  [Name = “Outputs”][SubName = “Layer”][Index = 0] RWTexture<float4> OutputDisplacement;  [Name = “Outputs”][SubeName =“Layer”][Index = 1]  RWTexture<float4> OutputNormal;  [Name =“Outputs”][SubName = “FinalColor”]  RWTexture<float4> FinalColor; }MaterialGroup SampleMaterial {  ObjectConstants = MaterialConstants; ObjectInputs = InputSurfaceProperties;  LayerOutputs =OutputLayerImages;  CompositeRenderingProgram = { PixelShader =ObjectCompositorPS; VertexShader = ObjectCompositorVS};  Layers  {  ComputeDisplacement:    Program = ComputeDisplacementComputeShader;   Outputs = Layer0;   ComputeNormalMap:    Program = ComputeNormals;   Inputs = Layer0;    Outputs = Layer1;   ComputeFinalColor:    Program= ShadeMaterial;    Inputs = Layer1, Layer0;    Outputs = FinalColor;  } }

Surfaces are defined in a parsed language syntax. The language isdefined in a text file which is parsed and translated into a series ofprograms and data which can be consumed by both the client and serverrendering system. In this example, the surface definition is called aMaterial Group, which contains a series of resource bindings, constantbindings, layer programs, the composite rendering program, and meta datawhich inform the system in its' operation. The material data consist ofcomprehensive reflection data, which includes delated and run-timequeryable information on every input and output parameter consumed bythe layer programs and the composite rendering program.

The surface definition defines how to render a 3D object, but itself isnot an actual object for rendering. The actual object will contain thevarious pieces of data which the surface definition needs to generate animage of an object. Much of this data is surface parameters which areconsidered invariant to the 3D object, such as albedo color, normal map,and specular power.

Surface Property Description Language

Surface properties of an object are defined in a custom language whichspecifies the number and nature of each intermediate and final objectimage layer, as well as the programs which will generate the layer andpossibly consume other intermediate object image layers. The surfaceproperty evaluation program is also defined here, such that the processby which the final image is rendered from the object image layers isentirely customizable for each object if so desired.

 Material Terrain  {  Layer TerrainMask: Shader=TerrainMask;Output=Layer0;SampleRate=Half;  Layer Height: Shader=HeightCalc;Output=Layer1;  Layer Normal: Shader=BilateralNormalCalc;Read0=Height;Output=Layer2;  Layer Grass: Shader=GrassShader;Read0=Normal; Read1=TerrainMask; Output=Layer3;  Layer BlurGrass:Shader=GuassianBlur;Read0=Grass;Output=Layer0;  FinalLayer = BlurGrass; }

In this example, Terrain is composed of five layers. TerrainMask iscalculated at only half sampling rate of the other layers, to save onmemory and computation. The Height is calculated by the height Layerwhich is processed into a normal by the Normal Layer. These are thenconsumed by the GrassShader which consumes the TerrainMask and Normallayers. Finally, BlurGrass blurs the layer which is marked as the finalimage layer which will contain a color that is used by the renderingstep.

The surface property description language may define a specializedprogram to perform the reading of the final object image layers andtranslate it into the final image. This evaluation program could combinemultiple object image layers in arbitrary combinations to compute thefinal image, or do something little more than finding a color propertyin a final object image layer and outputting that to the final image.

This evaluation program could blend object image layers from previousframes to amortize or smooth out surface property evaluation changeswhich occur frame to frame, such as specular highlights changing basedon view angle. This can facilitate surface property evaluation at a ratelower than the rate of rendering the final image. In other words, theobject image layers may be reused across multiple frames.

Resources are collections of data such as textures or buffers existingon a GPU memory, but may be also be stored in other computing devicesmemory than the one which is executing a layer program or compositerender program. Examples include 2D textures, Cube Textures, Texturearrays, writable buffer, unordered access views (UAV), index buffers,any data accelerated data structures needed for ray tracing, and caninclude any pieces of structured data which is consumed by the devicewhich is execute either the layer program or the composite renderingprogram. The resources can also be the layers themselves, which arebound via meta data

Constant data bindings are sub pieces of data which may be stored in aspecific resource, but constant data is typically used to communicatedata from the system submitting the rendering commands, often a CPU, tothe device consuming the commands, often a GPU.

The layer programs are data wide, parallel programs which consume datafrom the resource bindings, constants data, and layer images, and outputtheir results to one or more layer images. Each layer program declareswhich layer images to which they output their results, and which layersthey can consume. Layer programs need not write or consume from anyother layer program, and may even read and write to the same imagelayer.

Each layer program further has meta data associated with it declaringthe frequency which it should be updated, which can be linked tospecific game events or temporal frequency. A layer program may declareitself, for example, to update once every other frame. This allowsexpensive operations to not be recalculated if the system knows thatthere is no change occurring, or for some operations to be recalculatedat a lower temporal frequency. In one instantiation of this, a normalmap may be calculated from a displacement map, if the displacement maphas not changed then the generated normal map (which would be stored inone of the layers), need not be reprocessed. Layer programs can also befully enabled or disabled by the host system, such that for a particularobject a layer may or may not be executed. Each layer program can updateitself independently of other layer programs.

In addition to layer programs updating the entire layer at varyingtemporal frequency, a layer program can execute partially in a series ofprogressive iterations. This is called a progressive update. To performa progressive update, the layer processing system tracks and maintainsfor every object and for every layer program, two pieces of vital datato the layer program, one being the current iteration count, and theother being the total number of iterations possible. The layer programcan then use an arbitrary sample mask to decide which samples in thelayer image to update or compute.

One manifestation of this in a layer program is checkerboard renderingpattern where alternating blocks of layer image samples are processed.This is similar to checkboard rendering techniques which occur indeferred renderers, however the technique is being applied in objectspace, decoupled space and applied on arbitrary surface properties foreach surface definition rather than a single surface property such aswould occur across entire frame as in a deferred renderer.

Layer programs and Layer Image contain arbitrary surface properties,stored in layer image samples as numerical data, in this system. Thatis, they do not contain specific surface properties such as position orcolor, but rather contain whatever data is defined by the author of thelayer programs and composite rendering program. Typically, these arecreated by a technical artist for specific use cases, such as renderinghuman skin or making shiny metal. However, there exist a small number ofsurface properties the system recognizes such as the final shaded color.One example of using these layers would be to create a separate layerfor each eye of a VR system, thereby allowing the shade calculations ofa VR program to be computed simultaneously.

On example of the layer program manifestation is a compute shader inDirect3D or Vulkan. However, other forms of parallel computing programscan also perform the same function. For example, compiled SSE x86, Pixelshaders, Cuda, or OpenCL programs could perform equivalent functionalityand some devices one of these forms of the layer program might beutilized.

The composite rendering program is a program which consumes some of thelayer images and produces a view space image representation of anobject. One implementation of this is a vertex, geometry and pixelshader grouping which take some of the resources on input and rasterizethe mesh into an image buffer. Another implantation would be a hitshader and vertex skinning shader which would allow the generated layersto be added into a ray traced scene.

There are distinct advantages of allowing general execution in any ofthese types of programs. For example, if the layer programs areimplemented via a compute shader, the program can access neighborinformation without having to explicitly store the results into anotherlayer, via the local shared memory property. This allows for increasedefficiency since the intermediate values need not be stored in anintermediate object image layer.

Parameterized 3D Objects

A 3D object that is rendered into an image is a corner stone in computergraphics. It is often referred to as a Mesh or a Model. A Mesh or Modeldescribes the geometry of the 3D object via a collection of parts, whichare sometimes referred to as surfaces or primitives. Generally, a Meshis used to refer to a 3D model with primitives that consist of trianglesor polygons, while a model can have a higher level representation of 3Dprimitives such as NURBS or sub division surfaces.

For the purpose of this disclosure, the exact representation of 3Dobject does not matter so long as the 3D model has a parametrization,that is, some function which can take a point on the surface of themodel and map it to some type of data storage location that iscontinuous in R2. That is, points near other points should also be otherpoints in the data storage location, at least in terms of their abilityto be discovered, not necessarily physically close in memory.

Usually, 3D Objects have a texture parameterization which provides aconvenient method of mapping points on the surface of the 3D geometryinto a texture map. This is referred to as a texture atlas. Any 3Dobject which has a texture atlas automatically meets the criteria neededfor this disclosure.

Scene Management System

The scene management system receives messages from an Engine and buildsa scene database based on these messages, which contains the informationneeded for the creation of a view space image. The scene data basecontains references to multiple surface property definitions (FIGS. 4and 5), which contain the data needed for the rendering of objects.These surface property scene definitions will also be referenced by alayer program system and a composite rendering system. Theses sceneproperty scene definitions contain more than just the surface propertydefinitions (FIGS. 4 and 5), but also contain precals (FIG. 6).

A host system sends to the scene management system the state of theworld via a sequence of messages, which indicate things like position,object type, animation state, and so forth. These messages may beprocessed locally, or could be replicated or transmitted across anetwork to a server version of the scene management system, which itselfcould be running in a cloud computing system, with multiple instances ofthe same scene running on separate computing devices.

A scene management system receives these messages and constructs a scenefrom them. Any object which is visible would be represented in some formin this scene management. The scene is not what is currently visible toa user of this system, but it is rather a super set of everything thatis currently being considered as relevant to a view space image. In agame, this scene may extend substantially beyond what is currently knownor possible to visible to the user.

In a typical scene, tens of thousands of objects may be tracked. A scenemanagement system maintains full information about the current cameraview. Unlike other systems, a scene management system also tracksinformation relevant to future state of every object. For example, it isfully aware of the animation state of each object and can predict forsome amount of time in the future, typically less than 500 milliseconds,of where that object will be and what it will be doing.

A scene management system does not directly render the object at its'current time, but instead uses an estimated latency time to construct atemporal compensation database (FIG. 8) based on a collection of timingsmaintained throughout the system relating to latency of varies parts ofthe overarching application (from the client to the server portion).That is, it may calculate that there is a total gap of 100 millisecondsbetween the engine which generated the scene commands and the time atwhich all the composite rendering programs have completed theirgeneration of their corresponding objects into the View Space Image. Ifa car was moving at 30 m/s, thus, it would update the temporalcompensation database such that layer programs could, should they chose,project the car in the scene three meters ahead of its' currentposition, projected along the likely path as provided by the gameplaystate. In some cases, the temporal compensation may provide a range ofpossible locations, in which case a layer program may respondappropriately, for example dulling a specular highlight of an object inmotion.

In the aforementioned example of an object, in this case a car, is notactually rendered at the projected location, rather the layer programsare executing using the appropriate bindings for the object at thispoint in time. That is, data bindings are routed the correct places inthe temporal compensation database such that any surface propertiesstored in the layer images will be compensated for the point of time inthe future of which they will be consumed. It may be the case thatdifferent layer programs are using different time projections, such thata height map layer is using a projection 200 milliseconds in the futurewhile a specular color layer is using data on 50 milliseconds in thefuture. This is entirely specified by meta data associated with thelayer programs. By using image layers which have been temporallycompensated inside a composite rendering program, this inventioneffectively mitigates nearly all perceived latency caused by thecomputation of the surface properties being computed with a latency thatis far higher then what traditionally is understood to be perceptible byhumans.

The composite rendering programs will not typically use data thetemporal compensation database, instead they utilize on the currentstate of the object. The temporal compensation is necessary so that insituations where there exists a high amount of latency, such as anetwork transmission of the shading from one device to the next, thatthe composite rendering program, which is executed sometime after thelayer programs, is consuming data which more accurately represents itstrue state, rather than a state in the past.

Once this temporal compensation database is constructed, the scenesystem considers all relevant objects combined with this database tounderstand and estimate the state of an object when the layer imagesgenerated will actually be consumed via a composite rendering system.The temporal compensation database, strictly speaking, is not a singlestate, but rather a distribution of states. The scene management systemunderstands that it will send two types of requests, requests for layerimage processing and requests to the composite rendering system, but asthe systems may run in parallel the requests sent to the layer imageprocessing system will be consumed by the composite rendering system atsome point of time in the future. Hence, the need for the temporalcompensation.

As part of this process, the scene management system will performculling. However, this culling will occur against the temporallycompensated state of the screen, which can be a set of possible futurestates. In one instance of this, a camera may be moving along a pathwith its' future motion constrained to a set of possible locations. Thescene management system will cull against this range of futurepositions, rather than a specific location. In this manner, twoimportant numbers are calculated. The first number is the probabilitythat at least some of the layers will be consumed by the compositerendering program, and the second is a weighting of how important thesampling density should be, or how much fidelity a layer should have.

These two numbers can be wildly different. For example, an object faraway in the distance the system may calculate the first number near 100%probability of it being visible and thereby needing to have its layersupdated or computed. But, because it is far away, it is given a lowpriority on the number of layer samples it needs. Likewise, an objectwhich is just barely off screen and is directly in the path of thepredicted camera could be given a probability of being visible at only50%, but a high priority in the number of layer samples used, or layerfidelity.

These two numbers are used to generate a collection of objects torequest for shading. The system prefers to shade things which have lowerprobability of being visible with a low amount of layer fidelity, boththe conserve computation, but also to lower the amount of memory neededto store the system.

The scene management system then sends requests to the layer processingsystem, for all objects and their corresponding layer images which needupdating, to the layer processing system, using aforementioned temporalcompensation.

In addition to sending requests to the layer processing system, thescene management system also computes a different and distinct cullingagainst the actual scene information, building a collection of allobjects and their image layers which are needed to render into a viewspace image. It then sends this collection of objects to a compositerendering system which tell it how to consume image layers. However, therequests are occurring asynchronously so that the composite renderingsystem is actually using a previous iteration layer images. Thecomposite rendering system understands which image layers to use via aUUID which is shared between the messages sent to layer processingsystem and composite rendering system.

In some configurations, the scene management system may run in aclient/server mode. In this mode, there will exist some number of clientscene management systems and server scene management systems. The clientscene management systems will broadcast their state to the server scenemanagement systems, which will replicate a scene database from thesemessages. The server scene management system will not send theserequests to the composite rendering system, except in cases where itwishes to use the services of a composite rendering system to determineculling information. Instead, it will send only the requests for layerimage processing to a server version of the layer processing system,which will then synchronize with the client layer processing system,thereby offloading computation from the client device.

Layer Processing System

Referring now to FIG. 7, the layer processing system receives messagesfrom the scene management system. These messages consist of data whichdesignates which section of the image layers, which correspond tosurfaces of an object, and meta data provided by the gameplay systemwhich can be used to filter or updates different layers at differentfrequencies. Each message contains a UUID code which identifies thelayer request for eventual consumption by the composite renderingprogram.

Also included in the message is the amount of fidelity the scenemanagement system believes is needed for the surface and thereby thevarious layers.

Some state which is generated is too large to bind and manage throughconstant data binding systems, and instead uploaded directly into aresource which is consumed via a resource binding. This is done foranimation data that represents a pose of a 3D object. In this case, thepose data consists of a large number of indexable matrices which arereferenced by image layers and also the composite rendering program. Ina case where the layer program processor is running on a remote server,this animation state is broadcast as its' own, independent message.

Each object to be rendered contains its surfaces, and each surface muststore the layer images in memory which can eventually be consumed byeither one of the layer programs, and some of the layer images will beconsumed by the composite rendering program.

Because some sections of the layer images will not be sampled, it wouldbe wasteful to allocate and compute them. Because of this, the layerprogram system uses a layer control image to both prune work that is notneeded, and to avoid allocating memory that will not be used. This isdone in two ways. In one method, the layer control image is transferredfrom whatever memory and device it was generated into memory visible bythe layer program system. For example, the layer control image maybe begenerated in some form on a GPU, but need to be considered by a CPU. Thenow accessible layer control image is used to determine what sections oflayer images, if any, were consumed by the last frame. The layer programsystem then uses this information to consider how much, if any, requestsit will generate to execute and store the layer programs and theirrespective image layers.

The second use of the layer control image is to use a mask to prune offsections of computation that are allocated into memory, do not need tobe processed. Because it is difficult to know precisely which layerimage samples might become visible in the near future, the control imagelayer is not used directly, but rather it is extended such that sectionsof the layer control image which are marked as unused but are nearenough to sections that are marked as used will be marked forprocessing. Any individual layer program may elect to not have workpruned off in this manner. This step vastly increases the efficiency ofthe layer programs at some expense of memory—though the memory willnever be either read or written to.

In the next step, the layer processing system sorts and allocates thelayer images into memory appropriate for the layer programs to read andwrite. In one manifestation of this, the memory exists on a GPUcomputing device, but could be split across multiple computing devices.The total amount of memory used may be constrained, or unconstrained. Inthe unconstrained mode, the system will process all the requests,regardless of the total size. In this mode of operation, the system willgrow and shrink the total amount of processing and memory based on thetotal amount of memory needed to execute all the layer programs

In the second mode of operation, the layer execution system resizes thelayer process requests to fit into a fixed size of memory. In this mode,the total amount of memory used for the system is fixed, and the systemwill make repeated refinement attempts to reduces the memory into thefootprint. The system will prioritize things which are known to bevisible over things which are only predicted to be visible. If thesystem sets the memory footprint to N Gigabytes of memory, the layerprocessing system will reduce, using a set of fairness metrics toachieved the aforementioned priorities, the layer images such that thetotal number of layer image samples fits can be stored in N Gigabytes.

Once the allocation step has been performed, the layer execution systemhas a list of layer programs and their associated destination and sourcelayer images which need to be executed. This list is further sorted tominimize the total number of state changes such as resource bindings andprogram changes, to maximize the increase in hardware efficiency.

The layer processing system also maintains past history of the layersand maintains the layer image database. In this database, the results ofthe layers can be found by using the UUID provided in the message toprocess the layer. The database lookup is based on the UUID specified inthe message from the scene management system, such that one objectssurface can be stored and retrieved across time.

The inputs for each layer program are specified by metadata in thesurface definition language, with the layer binding system, describedlater, performing the binding. The inputs are typically a set ofparameter image maps (such as position, displacement, tangent, etc.),the intermediate results are known as intermediate object image layers,and the object image layers which are used for rendering an image arefinal object image layers.

The layer processing system builds a collection of layer programs toexecute, and then broadcasts or submits them to a computing device forexecution. In one manifestation, this is a GPU, but could include amultitude of computing devices. The layer processing system containsdependencies between all the layers, and issues the layer programs forexecution in an order optimal for the particular computing device beingused, and dispatch the layer programs for execution on differentcomputing systems and issue the appropriate copies and synchronizationsbetween the devices. The completion of this process results in acollection of layer images which are managed by the layer processingsystem, and possibly stored for future reference.

During the execution on the computing device, the layer programs willstore their results into the layer images. In one manifestation, thelayer images are renderable 2D textures which are exceptionallyefficient to use on GPUs. However, the layer images could be higherdimension so long as the appropriate coordinate mapping is provided. Thecoordinate may be non-spatial, for example, a third coordinate mightrepresent the surface changing over a time period. Or, an object imagelayer may be a voxel representation (FIG. 9).

All intermediate and final layer images can be multi-dimensional, andeach layer image may store it's results in a different precision andformat from other layers. For example, a color value may be stored inonly 8 bits per channel, where a 3D normal might be stored in a 32-bitfloat. The sample rate and size of the layer images samples in a layerimage may further be different, specified by the surface definition. Thesurface definition, may, for example indicate that one of the layerimages should be twice the sample rate of the final image layer, andwould then be processed at twice the number of samples. This could beused for super sampling sub sections of the rendering process to achieveresults comparable to variable rate shading on other architectures.

The layer programs are executed in sequence such that the layer programfor an object and surface is always executed in their entirety beforeall subsequent layer programs for an instance of a surface are executed.Because of this, each layer program has direct access to the entireintermediate results of the previous layer, not just to the sampleswhich correspond to the layer image samples which it generates. Thisallows operations which are impossible in most material and shadingsystems to be easily performed. For example, instead of a normal mapbeing stored with an object, it is now straightforward to calculate anormal dynamically by creating an intermediate G buffer and performingstraightforward filtering operations on it. Although G-Buffers have beenused in deferred renders to dynamically create normals, they are oftenunusable and unstable because the local neighborhood information neededfor a stable filter cannot be present, and the g-buffer is highlysusceptible to variations from frame to frame, causing a shimmeringeffect. Because these layers are in object space, these problems do notexist. Other information can also be calculated easily, such ascurvature maps, local AO, and so forth.

Because some layer programs may need wide access to neighboring layerimage samples, the layer processing system will over process adjacentlayer image samples. In this process, for a given layer program thelayer processing system will over process layer image samples that donot map directly to any actual sample point on the 3D model, but whichare convenient for local discovery to adjacent layer image samples. Onemanifestation of a layer program, a Gaussian blur is generated viasampling a neighborhood of image layer samples, weighting them againstthe physical distance determined by another layer image which storesposition.

There may also exist surface properties which could be unique fordifferent views, but be computed simultaneously for improved efficiency.In one manifestation of this, a layer program can compute simultaneouslythe shading values for both eyes in a VR shading system. Because onlythe view direction and camera position are changed, much of the work canbe duplicated for a massive increase in efficiency.

Because the object image layers can persist across frames and can storearbitrary intermediate data, it is possible to have the previous framesrendering data accessible for other rendering operations which may ormay not be integrated into the surface parameter evaluation step.

It is also not necessary to re-compute the entire object image layer.For interactive rendering, it is more important that a shading frameratebe high enough to be seen as continuous, then the object surfaceproperties be exactly precise to the current frame.

Thus, the shading can occur progressively where only some of the dataelements in a surface property are updated each frame. In an objectimage layer, this might mean that every other pixel in the object imagelayer is updated each frame, further, the surface rendering programcould use more than the current frame (e.g. previous frames) data tointerpolate between the frames, thereby smoothing out any surfaceparameter transitions that might occur via Level of Detail (LOD) changesin the object being rendered.

Moreover, because the surface properties and final object image layersmay not be instantaneous, e.g. a final surface property evaluationprogram may use previous frame's data its reconstruction, it may benecessary to predictively evaluate the surface properties, sometimes forsurfaces which are not considered visible.

For example, if one of the final object image layers is designated asstoring the Lambertian lighting term, light probes can be sent into thescene and indirect lighting computed at various places in the scene.This is possible because the Lambertian terms for the scene are alreadystored thus all that is left to do is find them in the data storagechosen. This could be done by tracing rays into the scene, finding theintersection points, and then using the same lookup function the surfacerendering program would have used.

If this data is being used for more complex rendering operations thatare important to the final image rendering, it may be the case that someobject's final image layers which are not visible or used directly torendering the final image are used in any process which needs the sceneaccess. For this purpose, any visibility optimization which occursduring the visibility step needs to be modified so that any data neededwill be available for the appropriate rendering step.

Additionally, some object image layer shaders could be enabled by havingthe scene data available. An example of this is a reflection map wherethe scene is traced and the color for that reflection ray is stored intoa layer, eventually being incorporated into the final object image layerand thereby final rendered image.

An example of this would be a VR simulation with rapid head motion. Thehead may move so quickly that the surface property evaluation programdoes not all the data it needs to render into the final images. Bypredicting the direction and speed of the camera motion, the data whichis needed can be primed and ready.

Because an Image layer program has access to all layer images of aprevious frame of the surface of the 3D object being rendered, in onemanifestation of a layer program can extrapolate information and samplesfor previous layers thereby increasing quality. This technique isanalogous temporal anti-aliasing which uses corresponding samples ofprevious frames to construct a super sampled, higher quality samplepoint by using the previous N frames of data, where N is usually betweentwo and five frames. In manifestations of temporal anti-aliasing indeferred and forward renderers, there exists significant complexity indetermining the relevant previous and relevant sample point on thescreen in the frame data, since objects and camera are constantlymoving, becoming visible and invisible. This has the effect of an imagequality often looking sharp when the scene has no motion, but becomingnoisy, blurry or otherwise inaccurate as objects move even slightly.

This process, by contrast, allows previous samples to be foundprecisely. The system provides the exact information, typically in theform of an image texture coordinate transform, for each layer toprecisely find any stored sample that has been previously computed.Thus, for any layer image sample written or consumed by any layerprogram, this system has exact information of not only it's previousimage layer sample value, but also the previous image layer samples ofany adjacent samples. Any layer program may perform this process,irrespective of the types of data which it might generate.

This allows superior temporal upsampling filters, and moves temporalanti-aliasing techniques for Image View Space to Object Space. A layerprogram can access a complete history of its' local sample and allprevious layers, and then composite and weight these samples together togenerate a high quality shaded output. One manifestation of this is theconstruction of a shadow filter which considers a combination or allprevious samples of all shadow map values to produce a high qualityresult, where each individual frame only processes a handful of newsamples.

In addition to simple layer programs which consume data provided in thedata binding step, a layer program may be fully asynchronous, andbecause previous layers can be accessed, may generate data not to beused by the current set of layer programs, but for subsequent executionof a layer program and its' associated object. In this manner, an imagelayer can also be used to dispatch computation work which could occur ona GPU or other computing device, with the results of said computationbeing placed in an intermediate object image layer and done asynchronouswith the rest of the system

In one manifestation, an asynchronous ray tracing step is dispatched tocompute shadows. For this process, an object image layer first generatesan intermediate image layer for a given light direction. This layerwould be a type of g buffer with light direction property attached. Thelayer would be consumed as input into a ray tracing step, which wouldgenerate a layer which could be consumed by another object image layerand eventually into the final object image layer. Ray tracing may fullybe asynchronous such that it takes several hundred milliseconds beforethe layer image to be generated. Because of this, this layer may use apredicted position of the ray traced samples as provide by the scenemanagement system.

During this process, several frames worth of previous shading samplesmay be stored in the layer images, and all of these layers may beconsidered by another layer program in a large filter which integratesacross both time and space. Unlike a screen space version of this, thesamples are precise and unchanging along the surface of the object,providing additional stability. This system supports all types offilters, including machine learning denoising filters.

Image layer programs can use a variety of techniques to perform thecalculations of their corresponding surface properties. In one case, alayer program is a machine learned filter implemented as a layerprogram. To generate this machine learned layer program, the machinelearning process must be initiated on a large quantity of data. Tofacilitate this, the image layer processor operates in a mode where thelayer images are substantially oversampled and over processed to achievethe highest possible quality. For example, a highly precise radiositysolver might run during a first layer program, where a second layerprogram might create a noisy, approximated radiosity solution. The dataof the first and second layer programs is then used to generate a thirdlayer program which attempts to process the noisy solution such that ithas a similar quality to the high quality layer program.

In this configuration, a layer is marked as a learnable input layerimage, and is not actually used for rendering. The system runs in alengthy process by which the layer images are instead output to learningsystem to allow the training of a high quality layer program based onthe learned data.

Layer System Resource and Data Binding System

Specified in the language for the surface definition program, theresources and constants which are used by the program layers and theprovided via semantic naming. The layer resource binding system consistsof two distinct parts, the binding and resource aggregation system, adata repository system which stores any globally needed values as wellas any data in the temporal compensation database which is needed for alayer program to execute.

Data bindings for both constant and resources in the surface definitionlanguage are provided by a series of attributes, amongst them are aname, a subname, and index. These attributes are further aggregated withan implicit layer image frame index which corresponds to a number whichmoves backwards in time, since the image system may have severalversions of a layer from previous frames. Taken together, the systembuilds a hash from these data items and indexes into the data repositoryfor the specific resource or value that is needed.

For example, a material may request the view matrix for a particularshadow projection texture. Because multiple frames can exist of ashadow, there could exist multiple versions of this projection as it ischanging throughout time. Thus, the system choses the correct version ofthis view matrix by combining the aforementioned temporal frame indexinto the hash calculation and indexing the value into the repository. Inthis manner, data bindings will index to the correct version of the dataneeded, which is critical in cases where the system may need eitherpredicted or past version of a piece of data for correct rendering, andeach layer may need a different version of that resource or binding.

The binding system will automatically composite and build sets ofconstant data and place them into the appropriate memory for theexecution of the layer programs, as well as manage data bindings.

Transmission of Layer Images (Encode and Decode Modules)

Referring now to FIG. 2 and FIG. 3, in some configurations, there mayexist both a server and client version of both the layer processingsystem and the scene management system. In this configuration, theclient version of the layer processing system perform a subset or nocomputation of the actual layer programs, and instead uses layer imagesreceived to it from server versions of the layer processing system. Thescene management system may also duplicate the scene database on theserver so as to not need to transmit some of the data which the serverimage processing system might need. In this process, the messages sentto a client scene management system are further sent to a server scenemanagement system, which then sends requests to a server layerprocessing system which sends the layer images back to a client layerprocessing system.

In addition to the messages for image program processing being sent fromclient to server, the system all aggregates all known data bindingswhich have been read from the data repository, including data that ispart of the temporal compensation database, and transmits this data tothe server. For example, if there exists a camera view matrix in thesystem, the scene management system should have stored a future versionthis value based on its understanding the time lag needed for the futurestate. If there exists skinning or bone information, this information isalso broadcast, which is temporally compensated by the scene managementsystem.

In this manner, all necessary data to execute the layer programs hasbeen transmitted to the server, with the values being predicted asappropriate.

The server layer image processing system may not correspond one to onewith a client version of it. In some configurations, multiple clientsmay attach to the same server layer image processing system. This wouldbe useful in cases where several players in a multiplayer game exist inthe same scene, which would allow a layer system to aggregate duplicaterequests and reuse processed information.

In this configuration, the server layer management system works exactlyas described in aforementioned disclosure, but adds additional steps.The layer management system creates a context for each client thatconsists of a full or partial copy of the image layers, and any metadata which is needed to interpret them.

The server version of the layer processing system now performsadditional steps. After processing any individual layer image, it sendsthe layer to an Encode Module.

The Encode Module compares the results of the layer image to its' copyof the layer image of a client, and creates a delta image between theclient's layer image and the one computed on the server. If the clienthas no information in the layer, then it will presume the clients'version of the image layer is values of uninitialized.

This delta image represents the changes between the image layer frame onthe server and what exists on the client. This delta image is a minimumand sparse representation, since most sections of the image layer areunchanged from the previous frame. Changes which are zero changes areimmediately discarded, since no update need be sent. If a section of theimage layer has changed, the system further compares the image to anyprevious versions of the frame, creating additional delta images.

The Encode module then then creates a sequence of data packets usingstandard image compression techniques which includes lossy and losslesscompression techniques. Additionally, the system can compare the imagesfor previous versions of the layer images to see if a previous layer hasless data changes then the current layer. In this mode, it can broadcastthe data packets as changes from any of the previously stored layerimages, rather than the last image layer.

Layer Images can contain meta data allowing the exact algorithm forcompressing that layer to be customized or capped. For example, if alayer is known to only contain normal information, the compressor maythen translate the normal into an angular representation. Likewise, ifit's a color data it can break the data into separate luminance andchroma values, transmitting the results at different frequency.

A layer image can limit the total bandwidth and quality of its' updatesto reduce overall bandwidth. It may be determined, for example, that alayer does not contain information which requires precise data overtime. This might be true for a low frequency ambient occlusion pass.

After the Encode module computes all of the aforementioned packets, itthen may optionally perform entropy encoding on the packets andbroadcast them to a decode module of a client version of the layerprocessing system for decompression. The decode module will decode thepackets, and apply the changes into the image layer database. The encodemodule will replicate the decoding, such that it will maintain an exactversion of the client's image layer database. In this manner, errorwhich is introduced during the compression will not aggregate over timesince the encode module will encode the difference between the client'sactual version of the image.

In this mode of operation, the client layer processing may perform someor no execution of the layer programs themselves. Some layer programsmay be marked in the meta data to execute locally, in which case theywill run on the client. This is useful in cases where the latency andtemporal compensation are not sufficient. As an example, it would beappropriate for an object which has precise mirrored reflection tocompute these layer images locally, since any latency introduced byhaving the layer image processing remotely would be unsatisfactory.

However, in one configuration the client might not do any execution ofthe layer programs at all, and in this configuration may not evencontain any of the resources for the layer programs to execute on atall, though the client would still need any data required for thecomposite rendering program such as vertex buffers, index buffers etc.

In this configuration, the client need not ever have stored either inphysical memory or on a disk the input data. In a large, open world gamethis could represents hundreds of gigabytes of data that need not existon the client, and can exist only on the server. Because this data isexpensive and client memory is expensive, this can save considerablecost.

Composite Rendering System

The surface property description language defines a composite renderingprogram which consumes the layer images and other resources of the 3Dobject image layers and creates the actual manifestation of an objectinto a view space image. The composite rendering program can combinemultiple object image layers in arbitrary combinations to compute thefinal image, or do little more than using one of the layer images tofind the surface color and outputting that to the final image.

The composite rendering system (FIG. 10) receives requests from thescene management systems, and creates a View Space Image via executingthe corresponding composite rendering program. The composite renderingsystem uses the UUID given to it by the scene management system to bindthe layer images consumed by the composite rendering program to the datagenerated by the layer processing system.

The composite rendering system performs its' operation by sending to acomputing device, such as a GPU, a sequence of commands which willexecute a collection of composite rendering programs into a view spaceimage. If the composite rendering system is sending its' commands to aGPU, it may utilize pixel shaders, geometry shaders, tessellationshaders, vertex shaders and hull shaders, or ray hit shaders to performthe operations required to generate a view space image.

During their execution, each composite rendering program may alsoexecute a variety of tasks unique to this overall architecture.

Since each composite rendering program has access to previous frameslayer image as stored in the layer image database, it blends imagelayers from previous frames to amortize or smooth out surface propertyevaluation changes which occur frame to frame, such as specularhighlights changing based on view angle. This facilitates surfaceproperty evaluation at a rate lower than the rate of rendering the finalimage. In other words, the object image layers may be reused acrossmultiple frames. This could allow the shading of a 3D object to run atten frames per second or lower, but appear to be smooth since the shadedvalues could be stored in a layer image and interpolated.

The composite rendering program also may optionally mark which layerimage samples where actually consumed during its' execution. In onemanifestation of this process, the composite rendering program marksinto a layer control image which samples where actually consumed. Thelayer control image mirrors the mapping of one or more image layers,that is, each sample in a layer control will directly correspond to oneor a regular group of samples in a layer image. In the simplest form, alayer control image will be a reduced sampling rate of a layer image.For example, a layer control image may have only a quarter of the layerimage samples as the image layer it marks. Additionally, multiple imagelayers may map to the same image control layer since the compositerendering program often the image layer samples often have identicalmapping functions.

One manifestation of this is using texture footprint hardware availableon GPUs, if the layer image samples are read via texture samplinghardware. Texture footprints are used to generate a layer control image.In this process, a hardware sampler calculates and marks specific texelsin a texture which map to texels which are read, instead of performing atexture filter operation. This hardware process can guarantee that everylayer image sample which will be touched by the composite render programis marked by the corresponding layer control image sample.

The composite rendering system may optionally run the entire scene intwo passes. In the first pass, called a z prepass, only the z value ofthe Z Buffer is written to in the View Image, in the second pass, theactual object is generated and the layer control image is updated. Inthis manner, 3D objects and image layers which are not visible on thescreen will be indicated in the layer control image so that that thelayer program system need not process them. The layer control image isinitialized to unused before the execution of the composite renderingprograms. In a server/client configuration, there may exist a compositerender system on the server which only performs the first pass tooptimize execution of the layer programs. Further, the server may havean instance of composite rendering system for each client to compute thevisibility for each client independently.

In a further mode, the composite rendering system can also execute the zbuffer update z prepass such that the system has an understanding ofwhat might be visible in the near future by using the temporalcompensation database. In this mode, multiple sets of layer controlimages are generated by running multiple z prepasses. For example, thetemporal compensation database may indicate three possible future viewsof the camera, and therefore the composite rendering system will executethree z-prepasses rather than one. During each z-prepass, a unique layercontrol image will be generated. A final image layer control isgenerated from this collection of layer control images by unioning themtogether. It is this final layer control image which is sent to thelayer processing system.

During the execution of the composite rendering system, various timeinformation is stored such as the total round trip from server toclient, time between layer program execution and composite renderprogram execution, and the total time between the beginning of thecomposite rendering system execution and when the view space imagebecomes visible on the screen. These timings are sent to both the scenemanagement system and the layer processing system so they may considerthe timings for the construction of the temporal compensation database.

In addition to the surface property evaluation, which may includeshading, occurring on different computers or GPUs, all objects in ascene have no dependency on one another for their individual evaluation.

Thus, the surface property evaluation can occur on an arbitrary numberand distribution of computers, such as a large server system, providedthat any process which requires the entire scene data would need tosynchronize the sections of the object image layers needed for thisstep.

Object Image Layer Synchronization

Because the evaluation of an objects surface could occur on an entirelydifferent computing device from the device which is rendering the finalimage, the final object image layers must be synchronized between thedevices. The final image layer repository can be synchronized acrosssystems via a UUID for each discrete memory location, and thatsub-sections can be updated via defined viewports.

In one configuration, a system can have multiple GPUs where one GPUevaluates the final object image layers while another GPU which isconnected to a display consumes these final object image layers toperform the rendering of the scene. In this configuration, the finalobject image layers are transmitted from one GPU to the next.

In another configuration, one system can transmit the final object imagelayers across a network or wireless system such that more powerfulcomputing devices is performing the complex object image layerevaluation, where the other is performing the final image rendering.This is particularly useful for VR (virtual reality) applications, wherethe headset needs to be light weight and more power efficient.

Because the surface properties that are stored in the object imagelayers typically represent final shaded data, they often do not changequickly from frame to frame. Thus, during the synchronization of theobject image layers, as an optimization, the system can send an updateto the sections of the object image rather than the entire object imagelayer.

Further, because the final object image layers are typically stored as2D color images, a wide variety of video compression techniques can beused to compress the image layers. Video compression and decompressionhardware can also be repurposed to compress the final object imagelayers.

Compute Shaders and Non-Graphics Pipeline Computation of Object ImageLayers

The object image layers need not be implemented via the traditionalgraphics pipeline, such as pixel or fragment shaders. Rather, they canbe implemented entirely via a compute shader. This has a few distinctadvantages. The first advantage is that allows shading to execute on asimpler hardware front end, and on some hardware, natively asynchronousto the graphics pipeline. Shading which uses only compute can execute ona compute-only queue in APIS such as Vulkan and D3D12. A compute onlyqueue might not be a GPU at all, but could conceivably be any computingdevice.

A second advantage of executing a layer shader via a compute shader isthat by doing so, it allows the image layer shader to access neighborinformation without having to explicitly store the results into anotherlayer, via the local shared memory property. This allows for increasedefficiency since the intermediate values need not be stored in anintermediate object image layer.

Caching of Intermediates Object Image Layers

Each object image layer, being intermediate or final, can either betransient, meaning it does not persist across a frame, or can be cached,meaning the intermediate object image layer will persist for an objectuntil such time as it is evicted because the object has not beenrendered for some number of frames, or has been designated via someevent as needing to be updated.

In many cases, an intermediate image layer need not be ever updated. Forexample, a material layer of metallic chrome might have been defined totrigger on an intermediate layer mask that was a complex masking ofnoise, curvature, and other static masking of an object. But since themask is entirely invariant from frame to frame, there is no need toregenerate the intermediate.

Final object image layers may also be cached for similar reasons. Forexample, a surface property program might divide an object intoLambertian terms, which are not view-dependent, and specular terms,which are. The Lambertian portion is known to not be changing, orchanging very slowly and thus does not need to be updated at the samerate as the specular term. This can be designated by the surfaceproperty description language.

Layer Visibility

It is possible that some sections of the object image layer are notvisible or will not contribute to the final 3D rendered image. As anoptimization, these sections of the image layer can be excluded fromcomputation. The visibility detection would occur either as a CPU step,or could occur during a previous rendering step where the subsections ofthe final image layers which are needed for rendering are stored andaggregated for the next evaluation of the object image layers.

Some sections of a layer may not be visible simply because they arefacing away from the camera of the scene. In this case, it is notnecessary for feedback from the rendering step since this can bedetermined by evaluating the direction of the normal of the surfaceparameter, which will clearly indicate if those properties arebackfacing.

In some implementations, a method for rendering parameterized 3D objectsinto a frame image is as follows. A surface definition program iscreated and compiled into a collection of meta data, layer programs andcomposite program. Parametrized 3D Objects are created with the datathat is needed to execute the layer, during either the loading of the 3Dasset, or through some type of data processing step. Layer executionwill occur on a server, and the composite program will be run on aclient. The server and client may be different machines, such that layerinput data may not be present on the client. During rendering, the hostsystem determines which objects may be visible or are likely to bevisible on the screen, predicting visibility on the path of any camerawhich might alter the view frustum. The system then predicts theposition and state of the object will be in at the time the compositeprogram will consume the layers. The system assigns a shading weightbased on its prediction of the objects possibility of visibility, withobjects which may become visible shortly being shaded pre-emptively.

The parameterized 3D objects are submitted for processing using thepredicted state and predicated shading rate. Resources are bound usingthe meta data binding information provided in the material definitionlanguage. The submission is message based and may be transmitted from aclient computer, to the host computer for the execution of the layers.The latency between the transmission and processing of the request istimed. Any data which is needed for prediction of the state of theobject is sent, such as the objects velocity or animation blend state.The server allocates and manages the layer programs, taking care totrack and cache the layer data across frames, this process isasynchronous to the client's execution of the layer composite program.Previous frames computation of the layers can be stored and accessedarbitrarily, the total amount of aforementioned layers which can bestored is dependent on the available memory of the device. The previousframes layers will be made available by both the execution of the layerprogram and the composite rendering program. The server executes thelayer programs at the frequency specified by the meta data provided inthe layers, taking care not to update information that is not invalid(such as an intermediate normal map).

Layer programs may be executed in the entirety before the next layerprogram in a surface definition are executed. This allows adjacent datato be available. A layer program may execute against a server managedscene via a more complex operation such as a ray tracing step—storingthe values asynchronously. The server maintains a copy of the client'sversion of the layer data and compares it to the computation of thelayers. The server only tracks layer data which will be consumed by thelayer composite program. On the server, the deltas between the client(of which there may be multiple) and the server's layer data arecollected. On the server, the deltas are compressed via a lossy formatwhich utilizes the temporal locality of the samples. The deltas aretransmitted, if required, from the host to the client as a series ofdata packets. The client reconstructs the layer data from the packetsreceived by the servers and updates it's copy of the layer. The layercomposite program renders the object into the client's image based onthe maintained version of the layers. The entire time betweentransmitted the shade request and execute of the layer composite programis timed, and this time is transmitted to the server such that it canaccurately predict the state of the object

While the present disclosure has been described with reference to one ormore particular embodiments or implementations, those skilled in the artwill recognize that many changes may be made thereto without departingfrom the spirit and scope of the present disclosure. Each of theseembodiments or implementations and obvious variations thereof iscontemplated as falling within the spirit and scope of the presentdisclosure. It is also contemplated that additional embodimentsimplementations according to aspects of the present disclosure maycombine any number of features from any of the embodiments describedherein.

What is claimed is:
 1. A method of generating an intermediate layer, themethod comprising: generating local surface properties for a graphicsobject from parameter image maps; generating a first object imagesurface layer based on the local surface properties; storingintermediate surface results as an object image layer from the objectlocal surface properties; and rendering a second object image surfacelayer based on the stored intermediate surface results.